import { Module } from '@nestjs/common';
import { AuthService } from './auth.service';
import { AuthController } from './auth.controller';
import { UserService } from 'src/modules/system/user/user.service';
import { CryptoService } from 'src/modules/crypto/crypto.service';
import { AuthGuard } from './auth.guard';
import { JwtModule } from '@nestjs/jwt';
import { UserModule } from 'src/modules/system/user/user.module';
import { JwtStrategy } from 'src/common/strategy/jwt.strategy';

@Module({
  imports: [
    UserModule,
    JwtModule.register({ secret: process.env.JWT_SECRET, global: true })
  ],
  controllers: [AuthController],
  providers: [
    AuthService,
    CryptoService,
    {
      provide: 'APP_GUARD',
      useClass: AuthGuard
    }
  ],
  exports: [CryptoService, AuthService]
})
export class AuthModule {}
